<!DOCTYPE html>
<html lang="zh_CN">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

</body>
<script type="text/javascript">

    var people = {
        username: '李阳',
        age: 12,
        height: 175,
        weight: '65kg',
        eduction: '本科',

        run: function () {
            console.log(this.username, '我能跑步');
        },
        sing: function () {
            console.log(this.username, '我能唱歌');
        }
    };
    /*
    * 对对象属性的增删改查操作
    * 1. 增加属性
    * 2. 查看属性
    * 3. 删除属性
    * 4. 修改属性
    * */

    console.log('删除前===============');
    for (var attr in people) {
        console.log('属性', attr, ' 属性的值', people[attr]);
    }

    /*
    * 属性的删除
    * 语法：
    * delete 关键字 对象变量.待删除的属性
    * */
    delete people.username;

    console.log('删除后===============');
    for (var attr in people) {
        console.log('属性', attr, ' 属性的值', people[attr]);
    }


</script>

</html>
